package com.grass.p019lv.novel.adapter;

import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.androidsa.bttsddka.R;
import com.androidx.p013lv.base.bean.novel.Chapters;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;

/* renamed from: com.grass.lv.novel.adapter.NovelMenuAdapter */
public class NovelMenuAdapter extends BaseRecyclerAdapter<Chapters, Holder> {
    int chapterId = -1;
    String domain;

    public String getNumber(int i) {
        switch (i) {
            case 1:
                return "一";
            case 2:
                return "二";
            case 3:
                return "三";
            case 4:
                return "四";
            case 5:
                return "五";
            case 6:
                return "六";
            case 7:
                return "七";
            case 8:
                return "八";
            case 9:
                return "九";
            default:
                return "";
        }
    }

    public void setDomain(String str) {
        this.domain = str;
    }

    public void setChapterId(int i) {
        this.chapterId = i;
        notifyDataSetChanged();
    }

    public void MyHolder(Holder holder, int i) {
        holder.setData((Chapters) this.list.get(i), i);
    }

    public void onViewRecycled(Holder holder) {
        super.onViewRecycled((RecyclerView.ViewHolder) holder);
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new Holder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_novel_menu, viewGroup, false));
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.grass.lv.novel.adapter.NovelMenuAdapter$Holder */
    public class Holder extends BaseRecyclerHolder {
        TextView tv_chapter;
        TextView tv_title;

        public Holder(View view) {
            super(view);
            this.tv_chapter = (TextView) view.findViewById(R.id.tv_chapter);
            this.tv_title = (TextView) view.findViewById(R.id.tv_title);
        }

        public void setData(Chapters chapters, int i) {
            TextView textView = this.tv_chapter;
            textView.setText("第" + (i + 1) + "章");
            this.tv_title.setText(chapters.getChapterTitle());
            if (NovelMenuAdapter.this.chapterId == chapters.getChapterId()) {
                this.tv_chapter.setTextColor(Color.parseColor("#FF3687"));
                this.tv_title.setTextColor(Color.parseColor("#FF3687"));
                return;
            }
            this.tv_chapter.setTextColor(Color.parseColor("#D7D8D9"));
            this.tv_title.setTextColor(-1);
        }
    }
}
